<template>
  <van-nav-bar
    title="我的"
  />
  <div class="usermsg">
    <p v-if="isLogin">嗨购平台欢迎您：{{ usermsgname }}</p>
    <van-button type="primary" to="/Login" v-else>还没有账号去注册</van-button>
  </div>
  <OrdeGoods></OrdeGoods>
  <van-divider>为您推荐</van-divider>
  <van-cell v-for="item in list" :key="item" :title="item" />
  <van-back-top right="15vw" bottom="10vh" />
  <goodlist></goodlist>
  <MyFooter></MyFooter>
</template>
  
  <script>
import MyFooter from "../../components/footer.vue";
import OrdeGoods from "./OrdeGoods.vue";
import goodlist from "../Home/components/goodlist.vue";

export default {
  components: { MyFooter, OrdeGoods, goodlist },
  data() {
    return {
      usermsg: "",
      isLogin: true,
    };
  },
  computed: {
    isLogin() {
      if (localStorage.getItem("username") == "") {
        return false;
      } else {
        return true;
      }
    },
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
  },
  created() {
    this.usermsgname = localStorage.getItem("username");
    this.usermsgpwd = localStorage.getItem("password");
  },
};
</script>
  
  <style scoped>
.usermsg {
  height: 300px;
  background-color: rgb(185, 186, 186);
}
</style>